<!DOCTYPE html>
<html>
<head>
    {include file="common/meta" /}
    <style>
        .IndexTitle{
            word-wrap: normal;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
            margin: 0 20%;
            width: 60%;
        }
        .isimg img{
            
            height: 5rem;
        }
    </style>
</head>

<body>



<!--顶部导航-->
<div class="IndexHeader">
    <div class="IndexBackBtn"><a href="javascript:history.go(-1)"><img src="/map/images/return_black.png" alt="返回"/></a></div>
    <div class="IndexTitle">{$shop.name}</div>
    <div class="IndexSearch">
        {if $is_collect }
        <img onclick="collect_shop({$shop.id},2)" src="/map/images/stare_choose.png" alt="收藏"/>
        {else /}
        <img onclick="collect_shop({$shop.id},1)" src="/map/images/stare.png" alt="收藏"/>
        {/if}
        <!-- <img src="/map/images/share.png" alt="分享"/> -->
    </div>
</div>


<div class="CommonMain">
    <!--banner-->
    <div class="banner shopInfo">
        <div class="am-slider am-slider-default">
            <ul class="am-slides isimg">
			
			 <li><img src="{$shop.shop_image}" /></li>
                <!--{volist name="shop['shop_images']" id="vo"}
                <li><img src="{$vo}" /></li>
                {/volist}-->
            </ul>
        </div>
    </div>
    <div class="shop-di1">
        <div class="shop-di1-Box am-cf">
            <div class="img am-fl"><img src="/map/images/placeholder.png"/></div>
            <div class="text am-fl">
                <a href="https://map.baidu.com/mobile/webapp/search/search/qt=s&wd={$shop.address}&vt=map">
                    <p class="p1">{$shop.address}</p>
                    <p class="p2">(距您{$length ?? 0}km）</p>
                </a>
            </div>
        </div>
    </div>
    <div class="shop-di2 Mt60 shop_connomt">
        <div class="title">用户评价</div>
        <ul id="ul">

        </ul>
    </div>
    <div id="jiazai"></div>
</div>
<script>
    //banner
    $('.banner .am-slider').flexslider({
        pauseOnAction: false,            // Boolean: 用户操作时停止自动播放
        slideshowSpeed: 3000,           // Integer: ms 滚动间隔时间
        controlNav: false,               // Boolean: 是否创建控制点
        directionNav: false             // Boolean: 是否创建上/下一个按钮（previous/next）
    });
    $('.xingNum').each(function(){
        let that = $(this)
        let index = that.attr('data-index')
        let img = that.find('img')
        let xing='/map/images/xing.png'
        let xing_x='/map/images/xing_x.png'
        img.each(function(i){
            if(i<index){
                $(this).attr('src',xing_x)
            }else{
                $(this).attr('src',xing)
            }
        })
    })
</script>



{include file="common/script" /}

<script>
    function collect_shop(id,type){
        $.post("{:url('collect_shop')}",{id:id,type:type},function (res) {
            alert(res.msg);
            if(res.code == 1){
                history.go(0)
            }
        })
    }
</script>

</body>

</html>


<script type="text/javascript" src="__CDN__/assets/js/zepto.min.js"></script>
<script type="text/javascript" src="__CDN__/assets/js/PullToRefresh.min.js"></script>
<script>

    var n=1,flag=true;

    var refreshBox=new PullToRefresh({
        container:".shop_connomt",

        up:{
            callback:function(){

                setTimeout(function(){
                    n++
                    re_ajax(n)
                    refreshBox.endUpLoading(flag)

                },1000)
            }
        }
    })
    re_ajax(1);
    function re_ajax(page){
        $.ajax({
            type:"GET",
            url:"{:url('shop/shop_comment')}",
            dataType:"json",
            data:{
                page:page,
                id:"{$shop['id']}"

            },
            success:function(html){

                $('#ul').append(html);
                if(html==''){
                    flag=false;
                }
            },
            error:function(jqXHR){
                flag=false;
            }
        });
    }


</script>
